import bean.Person;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2024/11/30
 * @description 实现了FactoryBean接口，重写了getObject()
 * 这使得这个bean成为的特殊的bean，工厂bean
 */
public class PersonFactory implements FactoryBean<Person> {
    @Override
    public Person getObject() throws Exception {
        return new Person();
    }

    @Override
    public Class<?> getObjectType() {
        return null;
    }

    @Override
    public boolean isSingleton() {
        // 是否单例，默认true
        return FactoryBean.super.isSingleton();
    }
}
